import type { GetNoticeRequest, GetUserGroupSettingRequest } from '@/types/detail'
import type { Base2UserGroupRequest, BaseRequest } from '@/types/job'
import type {
  DaKa,
  DaKaAddRequest,
  DelRequest,
  Note,
  NoteAddRequest,
  NoteIndexRequest,
  Notice,
  TaskInfo,
  UserGroupSetting,
} from '@/types/notelog'
import { http } from '@/utils/http'

export const NoteIndex = (data: NoteIndexRequest) => {
  return http<Note[]>({
    method: 'POST',
    url: '/Note/NoteIndex',
    data,
  })
}
export const DaKaNoteIndex = (data: NoteIndexRequest) => {
  return http<DaKa[]>({
    method: 'POST',
    url: '/DaKa/NoteIndex',
    data,
  })
}
export const GetAllNotice = (data: GetNoticeRequest) => {
  return http<Notice[]>({
    method: 'POST',
    url: '/Notice/GetAllNotice',
    data,
  })
}
export const GetUserGroupSettingAPI = (data: GetUserGroupSettingRequest) => {
  return http<UserGroupSetting[]>({
    method: 'POST',
    url: '/User/GetUserGroupSetting',
    data,
  })
}
export const GetAllTask = (data: Base2UserGroupRequest) => {
  return http<TaskInfo[]>({
    method: 'POST',
    url: '/Task/GetAllTask',
    data,
  })
}
export const AddOrUpdate = (data: NoteAddRequest) => {
  return http<{}>({
    method: 'POST',
    url: '/Note/AddOrUpdate',
    data,
  })
}
export const DaKaAddOrUpdate = (data: DaKaAddRequest) => {
  return http<{}>({
    method: 'POST',
    url: '/DaKa/AddOrUpdate',
    data,
  })
}
export const Del = (data: DelRequest) => {
  return http<{}>({
    method: 'POST',
    url: '/Note/Del',
    data,
  })
}
export const DaKaDel = (data: DelRequest) => {
  return http<{}>({
    method: 'POST',
    url: '/DaKa/Del',
    data,
  })
}
